﻿@using Lib.core;
@using Lib.helper;

@using Bll;
@using Model.User;
@{
    Layout = null;

    UserModel model = ViewData["user"] as UserModel;
    if (model == null) { model = new UserModel(); }

    //设置网页关键词和title
    {
        ViewData[Bll.StaticData.Key.TitleKey] = "";
        ViewData[Bll.StaticData.Key.KeywordsKey] = "";
        ViewData[Bll.StaticData.Key.DescriptionKey] = "";
    }
}

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @Html.Partial(IncludePath("header"))
</head>

<body>
    @Html.Partial(IncludePath("body_top"))
    @Html.Partial(IncludePath("manage_nav"))


    <div class="container">

        <div class="row">

            <div class="col-md-12">
                <div class="box">
                    <div class="form-row">
                        <div class="col-md-2">
                            <label>昵称</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.NickName)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>邮件</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Email)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>标识</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Flag)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>头像</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Icon)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>描述</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Introduction)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>余额</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Money)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>电话</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Phone)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>QQ</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.QQ)" />
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="col-md-2">
                            <label>性别</label>
                        </div>
                        <div class="col-md-10">
                            <input type="text" class="form-control" value="@(model.Sex)" />
                        </div>
                    </div>
                </div>
                <script type="text/javascript">
                    $(function () {
                        $('.del_btn').click(function () {
                            if (!confirm("确定删除此用户？")) { return; }
                            post('/admin/user/useraction/',
                                {
                                    action: 'del',
                                    id: '@(model.UserID)'
                                }, function (data) {
                                    if (data == 'ok') {
                                        alert('删除成功');
                                        window.location.href = '/admin/user/userlist/';
                                    }
                                    else {
                                        alert(data);
                                    }
                                });
                        });
                    });
                </script>
                <div class="btn_row box right">
                    <button class="btn btn-x del_btn">删除</button>
                    <button class="btn btn-primary save_btn">保存</button>
                </div>
            </div>

        </div>

    </div>

    @Html.Partial(IncludePath("body_bottom"))
</body>
</html>
